package cn.supermarket.mapper;

import cn.supermarket.pojo.vo.PurchaseOrdersVO;
import cn.supermarket.pojo.vo.SimpleOrderVO;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;


import java.util.List;

@SpringBootTest
public class OrderSelectMapper {
    @Autowired
    private OrderMapper orderMapper;
    @Test
    public void selectOrder(){
        Long orderId=993163197326868480L;
        List<PurchaseOrdersVO>list= orderMapper.selectOrderById(orderId);
       for (PurchaseOrdersVO purchaseOrders:list){
           System.out.println(purchaseOrders);
       }
    }
    @Test
    public void updateOrder(){
        String modifyName="zxy";
        Long orderId=993984154043990016L;
        Integer isDisplay=0;
        orderMapper.updateOrderIsDisplay(orderId,isDisplay,modifyName);
    }
    @Test
    public void updateOrderIsEnable(){
        String modifyName="zxy";
        Long orderId=993163197326868480L;
        Integer isEnable=0;
        orderMapper.updateOrderIsEnable(orderId,isEnable,modifyName);
    }
    @Test
    public void updateOrderIsCancel(){
        String modifyName="zxy";
        Long orderId=993163197326868480L;
        Integer isCancel=1;
        orderMapper.updateOrderIsCancel(orderId,isCancel,modifyName);
    }
    @Test
    public void selectOrderByPurchaser(){
        String purchaser="张泽成";
        List<SimpleOrderVO> list= orderMapper.selectOrderByPurchaser(purchaser);
        for (SimpleOrderVO purchaseOrders:list){
            System.out.println(purchaseOrders);
        }
    }
}
